//  根据当前操作系统定制样式

// os模块

function addStylesheet(stylesheet) {
    var head = document.getElementsByTagName("head")[0]
    var link = document.createElement('link')

    link.setAttribute('rel','stylesheet')
    link.setAttribute('href',stylesheet+'.css')
    head.appendChild(link)

}

function labelOS(osName) {
    os_label.innerText = osName

}

//
function initialize() {
    // var os = require('os')
    // var os = os.platform();
    var platform =  process.platform;
    labelOS(platform)
    switch (platform) {
        case 'darwin':
            addStylesheet('mac')
            break;
        case 'linux':
            addStylesheet('linux')
            break;
        case 'win32':
            addStylesheet('windows')
            break;
        default:
            console.log('无法检测您当前的操作系统平台',platform)
    }
}

window.onload = initialize;
